package com.genexususa.eo.connection.google.test.users;

import com.genexususa.eo.connection.google.analytics.AnalyticsManager;

/**
 * Created with IntelliJ IDEA.
 * User: Emiliano Martinez
 * Date: 8/19/14
 * Time: 6:46 PM
 * To change this template use File | Settings | File Templates.
 */
public class ConsumeGetUsersAndSessions {

    public static void main(String[] args){
        String xml = "<GoogleAnalyticsQuery xmlns=\"L2TMedia1.5\">\n" +
                "\t<filePath>C:\\L2T\\nbov</filePath>\n" +
                "\t<applicationName>L2TMEDIA</applicationName>\n" +
                "\t<profileId>46876970</profileId>\n" +
                "\t<accountId>26548619</accountId>\n" +
                "\t<startDate>2014-04-01</startDate>\n" +
                "\t<endDate>2014-08-18</endDate>\n" +
                "\t<metrics>\n" +
                "\t\t<Item>ga:sessions</Item>\n" +
                "\t\t<Item>ga:newUsers</Item>\n" +
                "\t</metrics>\n" +
                "\t<dimensions>\n" +
                "\t\t<Item>ga:userType</Item>\n" +
                "\t</dimensions>\n" +
                //"\t<filters>\n" +
                //"\t</filters>\n" +
                "\t<maxResults>0</maxResults>\n" +
                "</GoogleAnalyticsQuery>";

        xml = "<GoogleAnalyticsQuery xmlns=\"L2TMediaTrunk\">\n" +
                "\t<filePath>/L2TData/usEmiliano</filePath>\n" +
                "\t<applicationName>L2TMEDIA</applicationName>\n" +
                "\t<profileId>65425896</profileId>\n" +
                "\t<startDate>2014-08-20</startDate>\n" +
                "\t<endDate>2014-08-20</endDate>\n" +
                "\t<metrics>\n" +
                "\t\t<Item>ga:newUsers</Item>\n" +
                "\t\t<Item>ga:sessions</Item>\n" +
                "\t</metrics>\n" +
                "\t<dimensions>\n" +
                "\t\t<Item>ga:userType</Item>\n" +
                "\t</dimensions>\n" +
                "\t<maxResults>0</maxResults>\n" +
                "</GoogleAnalyticsQuery>";


        AnalyticsManager am = new AnalyticsManager();
        String res = am.getUsersAndSessions(xml);

        System.out.println(res);
    }
}
